﻿using System.Collections.Generic;
using MessengerAPI;

namespace TfsCommunity.Collaboration.MessengerMod
{
    /// <summary>
    /// Presenter class for the Add User Dialog
    /// </summary>
    public class UserManagementFormPresenter
    {
        private readonly IList<IMessengerContact> _messengerUsers;
        private readonly IList<string> _tfsUsers;

        public UserManagementFormPresenter(IList<IMessengerContact> messengerUsers, IList<string> tfsUsers)
        {
            _messengerUsers = messengerUsers;
            _tfsUsers = tfsUsers;
        }

        public IList<IMessengerContact> MessengerUsersInternal
        {
            get { return _messengerUsers; }
        }

        public IList<UserPresenter> MessengerUsers
        {
            get
            {
                var users = new List<UserPresenter>();
                foreach (IMessengerContact user in MessengerUsersInternal)
                {
                    users.Add(new UserPresenter(user));
                }
                return users;
            }
        }

        public IList<string> TfsUsers
        {
            get { return _tfsUsers; }
        }

        public string SelectedTFSUser { get; set; }
        public string SelecetdMessengerUser { get; set; }
        public UserMappingCollection Mappings { get; set; }
    }
}